
import type { SelectOptionData } from '@arco-design/web-vue'
import type * as T from './type'
import http from '@/utils/http'

/** 获取字典数据 */
export function getSystemDictList(params: Pagination) {
  return http.post<PageRes<T.SystemDictItem[]>>('/sys/dict/searchDictType', params)
}
/** 新增字典数据 */
export function addSystemDictList(params: AnyObject) {
  return http.post('/sys/dict/addOrUpdateDictType', params)
}
/** 字典类型-删除 */
export function delSystemDictType(params: { id: string }) {
  return http.get('/sys/dict/delDictType', params)
}
/** 获取字典详情 */
export function getSystemDictDetail(params: { id: string }) {
  return http.get<T.SystemDictDetail>('/sys/dict/dictTypeDetails', params)
}
/** 字典数据列表 */
export function getSystemDictDataList(params: { dictId: string } & Pagination) {
  return http.post<PageRes<T.SystemDictDataItem[]>>('/sys/dict/dictTypeValues', params)
}
/** 获取字典数据映射 */
export function getSystemDictData(params: { dictCode: string }) {
  return http.get<T.SystemDictDataItem[]>('/sys/dict/dictTypeValueByCode', params)
}
/** 新增字典数据 */
export function addSystemDictData(params: AnyObject) {
  return http.post('/sys/dict/addOrUpdateDictTypeValue', params)
}

/** 字典数据详情 */
export function getSystemDictDataDetail(params: { id: string }) {
  return http.get<T.SystemDictDataItem>('/sys/dict/dictTypeValueDetail', params)
}
/** 字典数据-删除 */
export function delSystemDictDataDetail(params: { id: string }) {
  return http.get('/sys/dict/delDictTypeValue', params)
}

